/* Copyright 2009 Sony Mathew, Minneapolis MN. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
package com.xsm.muck.gwt.client;

import com.google.gwt.user.client.ui.Panel;
import com.xsm.gwt.widgets.client.AxisPanel;
import com.xsm.gwt.widgets.client.CustomPanel;

/**
 * @author Sony Mathew
 */
public class MuckTestSuiteBorderPanel extends CustomPanel {

    /** My IoC Dependencies */
    public interface Context extends CustomPanel.Context {
        public Panel getTestSuitePanel();
        public Panel getMsgPanel();
    }
    
    private final Context cxt;
    
    public MuckTestSuiteBorderPanel(Context cxt) {
        super(cxt);
        this.cxt = cxt;
    }
    
    /**
     * We just know we have one content i.e. the Test Suite Panel.
     * If allowed switching content within the Border then would be 
     *  listening to a BorderUpdateEvent or something similar. 
     * 
     * @see com.xsm.gwt.widgets.client.CustomPanel#build()
     */
    public MuckTestSuiteBorderPanel build() {
        AxisPanel main = new AxisPanel().width("100%")
        .x().width("100%")
            .x().width("100%").align(-1,1).space(5)
                .x(cxt.getTestSuitePanel()).q()
                .q()
            .x().width("100%").align(1,1).space(5)
                .x(cxt.getMsgPanel()).q()
                .q()
            ;
        
        add(main);
        return this;
    }

}
